<?php
	error_reporting(E_ALL);
	session_start();
	include_once("../inc/config.inc.php");
	include_once("../inc/client.functions.php");
	include_once("../inc/difference.function.php");
	
	// user must be logged in to view this section
	if(($_SERVER['PHP_SELF'] != '/client/index.php') && isset($_SESSION['loggedin']) && $_SESSION['loggedin'] != '1234'){
	  header("Location: ".$domain."index.php?l=no");
	  exit();
	}	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome to the client section of the COTC Intrnanet</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-2" />
<link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection"/>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print"/>
<link rel="stylesheet" href="../css/ui.css" type="text/css" media="all"/>
<!--[if IE]><link rel="stylesheet" href="../css/ie.css" type="text/css" media="screen, projection"><![endif]-->
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery.ui.js" type="text/javascript"></script>
<script src="../js/jquery.metadata.js" type="text/javascript"></script>
<script src="../js/jquery.validate.pack.js" type="text/javascript"></script>
<script src="../js/jquery.form.js" type="text/javascript"></script>
<script src="../js/jquery.edit-inplace.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function(){
	$('#date').datepicker({
		inline: true
	});
	$(".comments").editInPlace({
		url: "../inc/update-comments.php",
		field_type: "textarea",
		default_text:  "(Click here and send us comments and status updates that can help us with your website.)",
		textarea_rows: "15",
		textarea_cols: "25"
	});	
	$("form#update").validate({
		rules: {
			description: "required",
			title: "required",
			sname: "required"
		},
		submitHandler: function(form) {
			$(form).ajaxSubmit({
				success: function(){$('form#update').hide();$('div.success').fadeIn();},clearForm:true
			});
		}
	
	});
	$('.page').hide();
	$('#project').change(function() {
	    var page_id = $(this).val();
	    $('.page').show();
	    $.getJSON("../inc/get-pages.php", {id: page_id}, function(data){
		    page = $('#page');
		    page.empty();
		    $.each(data, function() {
		    	var option = $('<option/>').attr('value', this.id).text(this.name);
		    	page.append(option);
		    });
		});
	})
	
});
</script>
</head>
<body>
<div class="date">
<?= $today = date("F j, Y, g:i a");?>
</div>
<div class="container">
	<div class="span-24">
			<h1>Welcome <?= disp_full_name(); ?></h1>
			<h2 class="alt">Here you can submit changes and view the progress on your site, stay up to date.</h2>
			<hr />
	</div>
		<div class="span-4 colborder">
			<ul>
				<li> <a href="index.php" title="Home">Home</a> </li>
				<li> <a href="?c=yourprojects" title="Your Projects">Your Projects</a> </li>
				<li> <a href="?c=message" title="Messages">Messages</a> </li>
				<li> <a href="?c=requestupdate" title="Request Update">Request Update</a> </li>
				<li> <a href="?c=invoices" title="Invoices">Invoices (<?= invoice_count(); ?>)</a> </li>
				<li> <a href="<?= $domain ?>index.php?c=logout" title="Logout">Logout</a> </li>
			</ul>
		</div>
		<div class="span-16">
